package com.cs.dao.impl;


import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.cs.dao.UserDao;
import com.cs.model.SshUser;
@Repository("userDao")
public class UserDaoImpl<T> extends BaseDaOImpl<T> implements UserDao{

	@Override
	public SshUser searchUser(SshUser user) {
		String hql="FROM SshUser u WHERE u.uname=:uname AND u.upwd=:upwd";
		Query query=this.getCurrentSession().createQuery(hql);
		query.setString("uname", user.getUname());
		query.setString("upwd", user.getUpwd());
		List<SshUser> users=query.list();
		return users.get(0);
	}
	
}
